package com.atguigu.demo.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @ClassName : ExcelListener
 * @Author : 骆发茂
 * @Date: 2021/11/14 12:17
 * @Description : 读操作需要监听器
 */
public class ExcelListener extends AnalysisEventListener<DemoData> {
    //一行一行读取excel内容

    @Override
    public void invoke(DemoData demoData, AnalysisContext analysisContext) {
        System.out.println("***invoke***    //一行一行读取excel内容\n"  +demoData);
    }

    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头:"+headMap);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("=======读取完毕执行=============");

    }
}